import java.text.SimpleDateFormat;
import java.util.*;

class MyDate extends GregorianCalendar
{
  private static final long serialVersionUID = 1L;

  public MyDate()
  {
    super();
    System.out.println("MyDate, MyDate()");
  }

  public String getCurrentDate() {
	System.out.println("MyDate, getCurrentDate()");
	return getGMTFormatter().format(getTime());
  }

  public void finalize() throws Throwable
  {
	System.out.println("MyDate, finalize()");
  }
	
  public String toString()
  {
    System.out.println("MyDate, toString()");
	return super.toString();
  }
  
  private SimpleDateFormat getGMTFormatter() {
	System.out.println("MyDate, getGMTFormatter()");
	SimpleDateFormat dateFormatter = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US); 
	TimeZone tz = TimeZone.getTimeZone("GMT");
	dateFormatter.setTimeZone(tz);
	return dateFormatter;
  }
}